import request from '@/api/myRequest'

function addressList() {
  return request({
    url: '/lejuAdmin/companyAddress/addressList',
    method: 'get'
  })
}

// 收货默认
function setReceiveOne(data) {
  return request({
    url: '/lejuAdmin/companyAddress/setReceiveOne',
    method: 'post',
    data
  })
}
// 发货默认
function setSendOne(data) {
  return request({
    url: '/lejuAdmin/companyAddress/setSendOne',
    method: 'post',
    data
  })
}
// 新增收货地址
function save(data) {
  return request({
    url: '/lejuAdmin/companyAddress/save',
    method: 'post',
    data
  })
}
// 删除地址
function companyAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'delete'
  })
}
// 地址明细
function editAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'get'
  })
}
// 更新地址
function update(data) {
  return request({
    url: '/lejuAdmin/companyAddress/update',
    method: 'post',
    data
  })
}
export { addressList, setReceiveOne, setSendOne, save, companyAddress, editAddress, update }
